package com.eliza.kotlin.design.creation.factory.simple_1

/**
 * @version v1.0
 * @ClassName: Coffee
 * @Description: 咖啡类
 * @Author: 黑马程序员
 */

/*
* 
* */
abstract class Coffee {
    abstract val name: String

    //加糖
    fun addsugar() {
        println("加糖")
    }

    //加奶
    fun addMilk() {
        println("加奶")
    }
}

internal class LatteCoffee : Coffee() {
    override val name: String
        get() = "拿铁咖啡"
}

internal class AmericanCoffee : Coffee() {
    override val name: String
        get() = "美式咖啡"
}